﻿
package system.data;

import java.util.*;

import framework.core.*;
/*
	Author    :Jackey
	CreateTime:2008-03-03 10:31:29
*/
public class CustomerStaffBase extends Table 
{
public static final String TABLE_NAME = "T_CUSTOMER_STAFF";

private static final String BACKUP_TABLE_NAME = "T_CUSTOMER_STAFF_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_CUSTOMER_STAFF_BACKUP";


public static final String ID = "ID";

public static final String CODE = "CODE";

public static final String CUSTOMER_CODE = "CUSTOMER_CODE";

public static final String SELF_CODE = "SELF_CODE";

public static final String NAME = "NAME";

public static final String SEX = "SEX";

public static final String CARD_NO1 = "CARD_NO1";

public static final String CARD_NO2 = "CARD_NO2";

public static final String IS_DRAW = "IS_DRAW";

public static final String REMARK = "REMARK";

public static final String STATUS = "STATUS";

public static final String CREATE_USER_ID = "CREATE_USER_ID";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATE_TIME = "CREATE_TIME";

public static final String LAST_UPDATE_USER_ID = "LAST_UPDATE_USER_ID";

public static final String LAST_UPDATE_USER = "LAST_UPDATE_USER";

public static final String LAST_UPDATE_TIME = "LAST_UPDATE_TIME";


public static Vector m_fields = null;


private String m_id = ""; //序号

private String m_code = ""; //工号

private String m_customer_code = ""; //所属客户编码

private String m_self_code = ""; //自编码

private String m_name = ""; //姓名

private String m_sex = ""; //性别

private String m_card_no1 = ""; //卡号1

private String m_card_no2 = ""; //卡号2

private String m_is_draw = ""; //是否可临料

private String m_remark = ""; //备注

private String m_status = ""; //是否有效

private String m_create_user_id = ""; //创建人序号

private String m_create_user = ""; //创建人

private String m_create_time = ""; //创建时间

private String m_last_update_user_id = ""; //最后修改人序号

private String m_last_update_user = ""; //最后修改人

private String m_last_update_time = ""; //最后修改时间



	public String getId()
	{
	    return m_id;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_id = v ;
		markDirty(ID);
	}



	

	public String getCode()
	{
	    return m_code;
	}
	public void  setCode(String v)
	{
		if(getCode().equals(v)) return ;
		m_code = v ;
		markDirty(CODE);
	}



	

	public String getCustomerCode()
	{
	    return m_customer_code;
	}
	public void  setCustomerCode(String v)
	{
		if(getCustomerCode().equals(v)) return ;
		m_customer_code = v ;
		markDirty(CUSTOMER_CODE);
	}



	

	public String getSelfCode()
	{
	    return m_self_code;
	}
	public void  setSelfCode(String v)
	{
		if(getSelfCode().equals(v)) return ;
		m_self_code = v ;
		markDirty(SELF_CODE);
	}



	

	public String getName()
	{
	    return m_name;
	}
	public void  setName(String v)
	{
		if(getName().equals(v)) return ;
		m_name = v ;
		markDirty(NAME);
	}



	

	public String getSex()
	{
	    return m_sex;
	}
	public void  setSex(String v)
	{
		if(getSex().equals(v)) return ;
		m_sex = v ;
		markDirty(SEX);
	}



	

	public String getCardNo1()
	{
	    return m_card_no1;
	}
	public void  setCardNo1(String v)
	{
		if(getCardNo1().equals(v)) return ;
		m_card_no1 = v ;
		markDirty(CARD_NO1);
	}



	

	public String getCardNo2()
	{
	    return m_card_no2;
	}
	public void  setCardNo2(String v)
	{
		if(getCardNo2().equals(v)) return ;
		m_card_no2 = v ;
		markDirty(CARD_NO2);
	}



	

	public String getIsDraw()
	{
	    return m_is_draw;
	}
	public void  setIsDraw(String v)
	{
		if(getIsDraw().equals(v)) return ;
		m_is_draw = v ;
		markDirty(IS_DRAW);
	}



	

	public String getRemark()
	{
	    return m_remark;
	}
	public void  setRemark(String v)
	{
		if(getRemark().equals(v)) return ;
		m_remark = v ;
		markDirty(REMARK);
	}



	

	public String getStatus()
	{
	    return m_status;
	}
	public void  setStatus(String v)
	{
		if(getStatus().equals(v)) return ;
		m_status = v ;
		markDirty(STATUS);
	}



	

	public String getCreateUserId()
	{
	    return m_create_user_id;
	}
	public void  setCreateUserId(String v)
	{
		if(getCreateUserId().equals(v)) return ;
		m_create_user_id = v ;
		markDirty(CREATE_USER_ID);
	}



	

	public String getCreateUser()
	{
	    return m_create_user;
	}
	public void  setCreateUser(String v)
	{
		if(getCreateUser().equals(v)) return ;
		m_create_user = v ;
		markDirty(CREATE_USER);
	}



	

	public String getCreateTime()
	{
	    return m_create_time;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_create_time = v ;
		markDirty(CREATE_TIME);
	}



	

	public String getLastUpdateUserId()
	{
	    return m_last_update_user_id;
	}
	public void  setLastUpdateUserId(String v)
	{
		if(getLastUpdateUserId().equals(v)) return ;
		m_last_update_user_id = v ;
		markDirty(LAST_UPDATE_USER_ID);
	}



	

	public String getLastUpdateUser()
	{
	    return m_last_update_user;
	}
	public void  setLastUpdateUser(String v)
	{
		if(getLastUpdateUser().equals(v)) return ;
		m_last_update_user = v ;
		markDirty(LAST_UPDATE_USER);
	}



	

	public String getLastUpdateTime()
	{
	    return m_last_update_time;
	}
	public void  setLastUpdateTime(String v)
	{
		if(getLastUpdateTime().equals(v)) return ;
		m_last_update_time = v ;
		markDirty(LAST_UPDATE_TIME);
	}



	



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewCode(DBConnection con) throws Exception
	{
		return Value.view(getCode());
	}

	public String viewCustomerCode(DBConnection con) throws Exception
	{
		return Value.view(getCustomerCode());
	}

	public String viewSelfCode(DBConnection con) throws Exception
	{
		return Value.view(getSelfCode());
	}

	public String viewName(DBConnection con) throws Exception
	{
		return Value.view(getName());
	}

	public String viewSex(DBConnection con) throws Exception
	{
		return Value.view(getSex());
	}

	public String viewCardNo1(DBConnection con) throws Exception
	{
		return Value.view(getCardNo1());
	}

	public String viewCardNo2(DBConnection con) throws Exception
	{
		return Value.view(getCardNo2());
	}

	public String viewIsDraw(DBConnection con) throws Exception
	{
		return Value.view(getIsDraw());
	}

	public String viewRemark(DBConnection con) throws Exception
	{
		return Value.view(getRemark());
	}

	public String viewStatus(DBConnection con) throws Exception
	{
		return Value.view(getStatus());
	}

	public String viewCreateUserId(DBConnection con) throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser(DBConnection con) throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewLastUpdateUserId(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUserId());
	}

	public String viewLastUpdateUser(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUser());
	}

	public String viewLastUpdateTime(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateTime());
	}



protected CustomerStaffBase()
{
}

public void fill(CustomerStaffPageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getCode()!=null)
	{	
		setCode(pageData.getCode());
	}

	if(pageData.getCustomerCode()!=null)
	{	
		setCustomerCode(pageData.getCustomerCode());
	}

	if(pageData.getSelfCode()!=null)
	{	
		setSelfCode(pageData.getSelfCode());
	}

	if(pageData.getName()!=null)
	{	
		setName(pageData.getName());
	}

	if(pageData.getSex()!=null)
	{	
		setSex(pageData.getSex());
	}

	if(pageData.getCardNo1()!=null)
	{	
		setCardNo1(pageData.getCardNo1());
	}

	if(pageData.getCardNo2()!=null)
	{	
		setCardNo2(pageData.getCardNo2());
	}

	if(pageData.getIsDraw()!=null)
	{	
		setIsDraw(pageData.getIsDraw());
	}

	if(pageData.getRemark()!=null)
	{	
		setRemark(pageData.getRemark());
	}

	if(pageData.getStatus()!=null)
	{	
		setStatus(pageData.getStatus());
	}

	if(pageData.getCreateUserId()!=null)
	{	
		setCreateUserId(pageData.getCreateUserId());
	}

	if(pageData.getCreateUser()!=null)
	{	
		setCreateUser(pageData.getCreateUser());
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

	if(pageData.getLastUpdateUserId()!=null)
	{	
		setLastUpdateUserId(pageData.getLastUpdateUserId());
	}

	if(pageData.getLastUpdateUser()!=null)
	{	
		setLastUpdateUser(pageData.getLastUpdateUser());
	}

	if(pageData.getLastUpdateTime()!=null)
	{	
		setLastUpdateTime(pageData.getLastUpdateTime());
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,false,true,32,"序号"));

		m_fields.add(new Field(CODE,Value.TYPE_STRING,true,true,30,"工号"));

		m_fields.add(new Field(CUSTOMER_CODE,Value.TYPE_STRING,false,true,20,"所属客户编码"));

		m_fields.add(new Field(SELF_CODE,Value.TYPE_STRING,false,false,20,"自编码"));

		m_fields.add(new Field(NAME,Value.TYPE_STRING,false,true,20,"姓名"));

		m_fields.add(new Field(SEX,Value.TYPE_STRING,false,false,2,"性别"));

		m_fields.add(new Field(CARD_NO1,Value.TYPE_STRING,false,false,50,"卡号1"));

		m_fields.add(new Field(CARD_NO2,Value.TYPE_STRING,false,false,50,"卡号2"));

		m_fields.add(new Field(IS_DRAW,Value.TYPE_STRING,false,true,1,"是否可临料"));

		m_fields.add(new Field(REMARK,Value.TYPE_STRING,false,false,500,"备注"));

		m_fields.add(new Field(STATUS,Value.TYPE_STRING,false,true,1,"是否有效"));

		m_fields.add(new Field(CREATE_USER_ID,Value.TYPE_STRING,false,true,32,"创建人序号"));

		m_fields.add(new Field(CREATE_USER,Value.TYPE_STRING,false,true,50,"创建人"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,true,20,"创建时间"));

		m_fields.add(new Field(LAST_UPDATE_USER_ID,Value.TYPE_STRING,false,true,32,"最后修改人序号"));

		m_fields.add(new Field(LAST_UPDATE_USER,Value.TYPE_STRING,false,true,50,"最后修改人"));

		m_fields.add(new Field(LAST_UPDATE_TIME,Value.TYPE_STRING,false,true,20,"最后修改时间"));
		
	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_id = getString(rs,ID);

	m_code = getString(rs,CODE);

	m_customer_code = getString(rs,CUSTOMER_CODE);

	m_self_code = getString(rs,SELF_CODE);

	m_name = getString(rs,NAME);

	m_sex = getString(rs,SEX);

	m_card_no1 = getString(rs,CARD_NO1);

	m_card_no2 = getString(rs,CARD_NO2);

	m_is_draw = getString(rs,IS_DRAW);

	m_remark = getString(rs,REMARK);

	m_status = getString(rs,STATUS);

	m_create_user_id = getString(rs,CREATE_USER_ID);

	m_create_user = getString(rs,CREATE_USER);

	m_create_time = getString(rs,CREATE_TIME);

	m_last_update_user_id = getString(rs,LAST_UPDATE_USER_ID);

	m_last_update_user = getString(rs,LAST_UPDATE_USER);

	m_last_update_time = getString(rs,LAST_UPDATE_TIME);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(CODE))
	{
		return new Value(getCode());
	}

	if(f.equalsIgnoreCase(CUSTOMER_CODE))
	{
		return new Value(getCustomerCode());
	}

	if(f.equalsIgnoreCase(SELF_CODE))
	{
		return new Value(getSelfCode());
	}

	if(f.equalsIgnoreCase(NAME))
	{
		return new Value(getName());
	}

	if(f.equalsIgnoreCase(SEX))
	{
		return new Value(getSex());
	}

	if(f.equalsIgnoreCase(CARD_NO1))
	{
		return new Value(getCardNo1());
	}

	if(f.equalsIgnoreCase(CARD_NO2))
	{
		return new Value(getCardNo2());
	}

	if(f.equalsIgnoreCase(IS_DRAW))
	{
		return new Value(getIsDraw());
	}

	if(f.equalsIgnoreCase(REMARK))
	{
		return new Value(getRemark());
	}

	if(f.equalsIgnoreCase(STATUS))
	{
		return new Value(getStatus());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		return new Value(getCreateUserId());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		return new Value(getCreateUser());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		return new Value(getLastUpdateUserId());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		return new Value(getLastUpdateUser());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		return new Value(getLastUpdateTime());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(CODE))
	{
		setCode(v.getString());
	}

	if(f.equalsIgnoreCase(CUSTOMER_CODE))
	{
		setCustomerCode(v.getString());
	}

	if(f.equalsIgnoreCase(SELF_CODE))
	{
		setSelfCode(v.getString());
	}

	if(f.equalsIgnoreCase(NAME))
	{
		setName(v.getString());
	}

	if(f.equalsIgnoreCase(SEX))
	{
		setSex(v.getString());
	}

	if(f.equalsIgnoreCase(CARD_NO1))
	{
		setCardNo1(v.getString());
	}

	if(f.equalsIgnoreCase(CARD_NO2))
	{
		setCardNo2(v.getString());
	}

	if(f.equalsIgnoreCase(IS_DRAW))
	{
		setIsDraw(v.getString());
	}

	if(f.equalsIgnoreCase(REMARK))
	{
		setRemark(v.getString());
	}

	if(f.equalsIgnoreCase(STATUS))
	{
		setStatus(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		setCreateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		setCreateUser(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		setLastUpdateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		setLastUpdateUser(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		setLastUpdateTime(v.getString());
	}
	
}
public String toString()
{
	String msg = "CustomerStaff=\n";
	msg += "(\r\n";

	msg += "    序号(id)="+get("id")+"\r\n";

	msg += "    工号(code)="+get("code")+"\r\n";

	msg += "    所属客户编码(customer_code)="+get("customer_code")+"\r\n";

	msg += "    自编码(self_code)="+get("self_code")+"\r\n";

	msg += "    姓名(name)="+get("name")+"\r\n";

	msg += "    性别(sex)="+get("sex")+"\r\n";

	msg += "    卡号1(card_no1)="+get("card_no1")+"\r\n";

	msg += "    卡号2(card_no2)="+get("card_no2")+"\r\n";

	msg += "    是否可临料(is_draw)="+get("is_draw")+"\r\n";

	msg += "    备注(remark)="+get("remark")+"\r\n";

	msg += "    是否有效(status)="+get("status")+"\r\n";

	msg += "    创建人序号(create_user_id)="+get("create_user_id")+"\r\n";

	msg += "    创建人(create_user)="+get("create_user")+"\r\n";

	msg += "    创建时间(create_time)="+get("create_time")+"\r\n";

	msg += "    最后修改人序号(last_update_user_id)="+get("last_update_user_id")+"\r\n";

	msg += "    最后修改人(last_update_user)="+get("last_update_user")+"\r\n";

	msg += "    最后修改时间(last_update_time)="+get("last_update_time")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(CustomerStaffBase srcObj)
{

	setId(srcObj.getId());

	setCustomerCode(srcObj.getCustomerCode());

	setSelfCode(srcObj.getSelfCode());

	setName(srcObj.getName());

	setSex(srcObj.getSex());

	setCardNo1(srcObj.getCardNo1());

	setCardNo2(srcObj.getCardNo2());

	setIsDraw(srcObj.getIsDraw());

	setRemark(srcObj.getRemark());

	setStatus(srcObj.getStatus());

	setCreateUserId(srcObj.getCreateUserId());

	setCreateUser(srcObj.getCreateUser());

	setCreateTime(srcObj.getCreateTime());

	setLastUpdateUserId(srcObj.getLastUpdateUserId());

	setLastUpdateUser(srcObj.getLastUpdateUser());

	setLastUpdateTime(srcObj.getLastUpdateTime());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<CustomerStaff>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<Code>"+Value.view(getCode())+"</Code>";

	xml += "<CustomerCode>"+Value.view(getCustomerCode())+"</CustomerCode>";

	xml += "<SelfCode>"+Value.view(getSelfCode())+"</SelfCode>";

	xml += "<Name>"+Value.view(getName())+"</Name>";

	xml += "<Sex>"+Value.view(getSex())+"</Sex>";

	xml += "<CardNo1>"+Value.view(getCardNo1())+"</CardNo1>";

	xml += "<CardNo2>"+Value.view(getCardNo2())+"</CardNo2>";

	xml += "<IsDraw>"+Value.view(getIsDraw())+"</IsDraw>";

	xml += "<Remark>"+Value.view(getRemark())+"</Remark>";

	xml += "<Status>"+Value.view(getStatus())+"</Status>";

	xml += "<CreateUserId>"+Value.view(getCreateUserId())+"</CreateUserId>";

	xml += "<CreateUser>"+Value.view(getCreateUser())+"</CreateUser>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";

	xml += "<LastUpdateUserId>"+Value.view(getLastUpdateUserId())+"</LastUpdateUserId>";

	xml += "<LastUpdateUser>"+Value.view(getLastUpdateUser())+"</LastUpdateUser>";

	xml += "<LastUpdateTime>"+Value.view(getLastUpdateTime())+"</LastUpdateTime>";
	
	xml += "</CustomerStaff>";
	return xml;
}

}
